package edu.ustb.mis.dm.simpleTest;

import java.util.ArrayList;
import java.util.List;
import edu.ustb.mis.dm.Constants;
import edu.ustb.mis.dm.impl.algorithm.PWCABOSFV;
import edu.ustb.mis.dm.impl.data.WTextDataOutput;
import edu.ustb.mis.dm.interfaces.algorithm.ClusterAlgorithm;
import edu.ustb.mis.dm.model.WClusterResult;
import edu.ustb.mis.dm.util.FileUtils;
import edu.ustb.mis.dm.util.ResultAnalyzeUtils;

public class PWCABOSFVTest {
	public static void main(final String[] args) {
		final ClusterAlgorithm<WClusterResult> cabosfv = new PWCABOSFV(Constants.ZOO_SMALL_NAME);
		final String index = FileUtils.dirBuilder(Constants.ZOO_SMALL_NAME);
		for (Float i = 0.1F; i < 1.0; i += 0.05F) {
			final String dir = FileUtils.dirBuilder(index, i) + Constants.ZOO_SMALL_NAME;
			final List<List<WClusterResult>> clusterResultMatrix = new ArrayList<List<WClusterResult>>();
			for (int j = 1; j <= 10000; j++) {
				cabosfv.setDataOutput(new WTextDataOutput(dir, j));
				cabosfv.setThreshhold(i);
				cabosfv.execute();
				clusterResultMatrix.add(cabosfv.getResultList());
			}
			ResultAnalyzeUtils.printBridgePointAnalyzeResult(dir, ResultAnalyzeUtils.wbridgePointAnalyzeAll(clusterResultMatrix));
		}
	}
}
